<!doctype html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>标题</title>
<meta name='Keywords' content=''>
<meta name='Description' content=''>
<link rel='stylesheet' href='../css/fyz.public.style.css' />
<script type='text/javascript' src='../js/jquery-1.8.3.min.js'></script>
<style type='text/css'>
body{background:#EEEEEE;}
</style>
</head>
<body>
<style type="text/css">
/* InfiniterScroll star */
div.InfiniterScroll{width:1040px; overflow:hidden; height:200px; border:1px solid #dddd; position:relative; margin:50px auto 0px;}
ul.InfiniterScroll{width:1000%; overflow:hidden; position:absolute; top:0px; left:0px;}
ul.InfiniterScroll li{width:200px; height:200px; text-align:center; line-height:200px; font-size:50px; margin-right:10px; float:left; background:#fff;}
/* InfiniterScroll */
</style>
<div class="InfiniterScroll">
    <ul class="InfiniterScroll">
        <li class='con'>1</li>
        <li class='con'>2</li>
        <li class='con'>3</li>
        <li class='con'>4</li>
        <li class='con'>5</li>
        <li class='con'>6</li>
    </ul>
</div>
<script type="text/javascript">
(function($){
    $.fn.extend({
        'InfiniterScroll':function(options){
			var opts = $.extend({},InfiniterScroll_Defaluts,options);
			var $this = $(this);
			var $thisAll = $this.find('*');
			opts.liWidth = $this.find('li.con').outerWidth(true);
			opts.liSize = $this.find('li.con').size();
			if(opts.liSize>opts.showSum){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.click ++;
						if(opts.click < opts.liWidth){
							opts.left = -opts.click + 'px';$($this).css('left',opts.left);
						}else{
							opts.ulLi = $($this).find('li.con').eq(0);
							$($this).append(opts.ulLi);
							$($this).css('left','0px');
							opts.click = 0;
						};
				},opts.IntervalTime);};
				autoPlay();
				function clearIntervalFun(clearIntervalObj){
					$(clearIntervalObj).bind('mouseover',function(){clearInterval(opts.timer);});
					$(clearIntervalObj).bind('mouseout',function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
			};
		}
    });
   var InfiniterScroll_Defaluts = {
		click:0,
		liSize:'',
		showSum:5,
		IntervalTime:15,
		timer:null,
		left:'',
		ulLi:'',
		liWidth:200
	};
}(window.jQuery));
$("ul.InfiniterScroll").InfiniterScroll({IntervalTime:15,showSum:5});
</script>

</body>
</html>